package com.taotao.log4j2;

//import org.apache.logging.com.taotao.log4j.LogManager;
//import org.apache.logging.com.taotao.log4j.Logger;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Log4j2Test {
    @Test
    public void test01() {
//        Logger logger = LogManager.getLogger(Log4j2Test.class);
//
//        logger.fatal("fatal信息");
//        logger.error("error信息");
//        logger.warn("warn信息");
//        logger.info("info信息");
//        logger.debug("debug信息");
//        logger.trace("trace信息");
    }

    @Test
    public void test02() throws InterruptedException {
        Logger logger = LoggerFactory.getLogger(Log4j2Test.class);

        logger.error("error信息");
        logger.warn("warn信息");
        logger.info("info信息");
        logger.debug("debug信息");
        logger.trace("trace信息");

        try {
            int i = 1/0;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }

        System.out.println("================");
        System.out.println("================");
        System.out.println("================");
        System.out.println("================");
        System.out.println("================");
    }
}
